package com.tql.pandian.mapper;

import com.ruoyi.system.api.domain.EnabledShopDto;
import com.tql.pandian.entity.*;
import com.tql.pandian.entity.dto.MainDto;
import com.tql.pandian.entity.dto.SimpleDto;
import com.tql.pandian.entity.vo.HillKingDeeVo;
import com.tql.pandian.vo.TopCateStapProlossVO;
import com.tql.pandian.vo.TqlPandianPeriodVO;
import com.tql.pandian.vo.TqlStapProlossItemVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CommonMapper {
    List<String> getEnabledShop();

    TqlPandianPeriodVO findEnableGenPharse(String pandianCode);

    TqlPandianPeriodVO findEnableGenPharseUpper(@Param("deptCode") String deptCode, @Param("pcode") String pcode);

    List<EnabledShopDto> getEnabledHllShop();

    List<FoodDetailReportDayBean> findFoodReportDay(String tableName, Long shopId, Long startDate, Long endDate);

    int batchInsertFoodStatByReportDayAndShop(List<FoodDetailReportDayBean> list, String fnumber, String month, String pandianCode, Long starttime, Long endtine);

    void batchInsertStapSaleChangeByPeriod(@Param("list") List<TqlStapSaleChangeEntity> subList);

    List<FoodBomEntity> selectFoodAndFoodBomByFoodIdAndDeptCode(String foodCode, String fnumber);

    String findDeptCodeByUserId(Long userId);

    List<HillKingDeeVo> selectHillKings();

    List<Map> selectDeptCollection(String deptCode);

    List<Map> selectDeptAdminCollection();

    List<TqlStapProlossItemVO> selectStapPeriodProloss(@Param("pandianCode") String pandianCode,
                                                       @Param("std") Long std, @Param("etd") Long etd, @Param("type") Integer type);

    TqlStapProlossItemVO findTqlStapOutChange(@Param("tableName") String tableName, @Param("deptCode") String deptCode, @Param("stapCode") String stapCode,
                                              @Param("reportDate") String reportDate);

    void insetBatchProlossData(@Param("list") List<TqlStapProloss> prolossData);
//    Long selectDeptIdByDeptCode(String deptCode);

    void insetBatchProlossItemData(@Param("list") List<TqlStapProlossItem> prolossItemData);

    void insetBatchProlossDetailData(@Param("list") List<ProlossDetialDto> list);

    void deleteItemByPandinacode(String pandianCode);

    void deleteByPandinacode(String pandianCode);

    List<FoodAndBom> findFoodAndBom(String fnumber);

    List<FoodAndBom> findBillFoodPeriod(@Param("pandianCode") String pandianCode,@Param("foodCodes") String[] foodCodes);

    List<TqlHllShopBillFoodPeriod> selectTqlHllShopBillFoodReportDayList(@Param("tableName") String tablename, @Param("pandianCode") String pandianCode,
                                                                                  @Param("month") String month, @Param("shopId") Long shopId,
                                                                                  @Param("std") Long std, @Param("etd") Long etd);

    void delectTqlHllShopBillFoodPeriodByPandianCode(@Param("pandianCode") String pandianCode);

    void insertTqlHllShopBillFoodPeriod(@Param("list") List<TqlHllShopBillFoodPeriod> list);

    List<String> findfoodCode(@Param("fnumber") String fnumber, @Param("foodCodes") String[] foodCodes);

    int insertBomcardAnalysAndProfit(List<FoodAndBom> list);

    void deleteProlossDetailByPandinacode(String pandianCode);

    void deleteBomcardAnalys(String pandianCode);

    List<SimpleDto> findStapAndDeptFromInAndOut(String inTableName, String outTalbeName, String fnumber);

    List<SimpleDto> findStapAndDeptFromPandianData(String pandianCode);

    List<SimpleDto> findInDetailByStapAndDeptForTransferout(String inTableName, List<String> union);

    List<SimpleDto> findInDetailByStapAndDeptForTransferIn(String inTableName, List<String> list);

    List<SimpleDto> findInDetailByStapAndDeptForPurcharse(String inTableName, List<String> list);

    List<SimpleDto> findInDetailByStapAndDeptForIncase(String inTableName, List<String> list);

    List<SimpleDto> findOutDetailByStapAndDept(String outTableName, List<String> list, Long std, Long etd);

    List<SimpleDto> findLastPandianDetail(String pandianCode, List<String> list);

    List<SimpleDto> findThisPandianDetail(String pandianCode, List<String> list);

    void batchInsertProloss(List<MainDto> mains);

    void batchInsertProlossDetail(List<SimpleDto> union);

    List<TopCateStapProlossVO> findProloss(String pandianCode, String shopCode,String deptCode);

    String findLastPandianCode(String pandianCode);

    List<TopCateStapProlossVO> findProlossGroupDept(String pandianCode, String fnumber, String stapType);

    List<TopCateStapProlossVO> findProlossGroupStap(String pandianCode, String fnumber, String stapType);

    List<TopCateStapProlossVO> findProlossGroupStapDept(String pandianCode, String fnumber, String stapType, String deptCode);

    List<IncaseDto> findInfo(Long[] longArr, String tabName,int flag);

    IncaseDto findPandianById(Long thisPandianId);

    void saveShopBillReport1(String billFoodReportTableName, String billFoodTableName,String shopID);

    void updateShopBill1(String billFoodTableName, String shopID);

    List<TqlHllShopBillFoodPeriod> selectBillFoodPeriod(String pandianCode);

    List<TqlStapProloss> selectProloss(String pandianCode);

    List<FoodAndBom> findBomCardParse(String pandianCode, String type);
}
